package com.exposit.zbs.converters;

import com.exposit.zbs.model.User;
import com.exposit.zbs.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;


@Component
public class StringToUserConverter implements Converter<String, User> {

	@Autowired
	private IUserService userService;

	@Override
	public User convert(String userId) {

		return userService.getUserbyId(new Long(userId));
	}

}